/*
 * Copyright (C) 2021 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.prolificinteractive.materialcalendarview.sample;

import ohos.aafwk.content.Intent;
import ohos.agp.components.Component;
import ohos.agp.components.ListContainer;

import com.prolificinteractive.materialcalendarview.sample.Provider.MultipleViewProvider;

/**
 * @since 2021-07-12
 */
public class MultipleViewAbility extends BaseAbility {
    private ListContainer listContainer;
    private MultipleViewProvider mMultipleViewProvider;

    @Override
    public void onStart(Intent intent) {
        super.onStart(intent);
        toolbarTitle.setText("Multiple Basic Calendars");
        listContainer = (ListContainer) findComponentById(ResourceTable.Id_calendar_list);
        mMultipleViewProvider = new MultipleViewProvider(this);
        listContainer.setItemClickedListener(new ListContainer.ItemClickedListener() {
            @Override
            public void onItemClicked(ListContainer mlistContainer, Component mcomponent, int position, long var4) {
            }
        });
        listContainer.setLongClickable(false);
        listContainer.setItemProvider(mMultipleViewProvider);
    }

    @Override
    int contentLayoutRes() {
        return ResourceTable.Layout_ability_multiple;
    }
}
